package com.mydemo.design_pattern.action_type.chain_responsibility_pattern;

import com.mydemo.design_pattern.action_type.chain_responsibility_pattern.impl.ConsoleLogger;
import com.mydemo.design_pattern.action_type.chain_responsibility_pattern.impl.FileLogger;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: DemoTest, v1.0 2019-09-19 14:35 liming1 Exp $
 */
public class DemoTest {

    public static void main(String[] args) {
        ConsoleLogger consoleLogger = new ConsoleLogger(AbstractLoggerHandler.INFO);
        FileLogger fileLogger = new FileLogger(AbstractLoggerHandler.ERROR);
        consoleLogger.setNextHandler(fileLogger);

        consoleLogger.print(AbstractLoggerHandler.INFO,"在哪里可以看到呢");
        consoleLogger.print(AbstractLoggerHandler.ERROR,"应该在error上");
        consoleLogger.print(AbstractLoggerHandler.WARN,"应该哪也看不见");
    }
}
